home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / elan1v5.arc / DOC.ARC / H03.TEX < prev    next >
LaTeX Document  |  1989-03-17  |  11.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CRLF line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CRLF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 45 58 41 4d 50 4c 45 |\chapter|{EXAMPLE|
|00000010| 53 20 45 4c 41 4e 2d 30 | 20 53 55 42 53 45 54 7d |S ELAN-0| SUBSET}|
|00000020| 0d 0a 0d 0a 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |....The |followin|
|00000030| 67 20 65 78 61 6d 70 6c | 65 73 20 61 72 65 20 69 |g exampl|es are i|
|00000040| 6e 74 65 6e 64 65 64 20 | 74 6f 20 67 69 76 65 20 |ntended |to give |
|00000050| 61 20 66 6c 61 76 6f 75 | 72 20 6f 66 20 74 68 65 |a flavou|r of the|
|00000060| 0d 0a 45 6c 61 6e 2d 30 | 20 73 75 62 73 65 74 20 |..Elan-0| subset |
|00000070| 61 6e 64 20 6f 66 20 74 | 68 65 20 73 74 79 6c 65 |and of t|he style|
|00000080| 20 6f 66 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 | of prog|ramming |
|00000090| 74 68 61 74 0d 0a 63 61 | 6e 20 62 65 20 61 63 68 |that..ca|n be ach|
|000000a0| 69 65 76 65 64 20 77 69 | 74 68 20 69 74 2e 20 46 |ieved wi|th it. F|
|000000b0| 75 72 74 68 65 72 20 65 | 78 61 6d 70 6c 65 73 20 |urther e|xamples |
|000000c0| 28 61 6e 64 20 6d 75 63 | 68 20 6d 6f 72 65 20 61 |(and muc|h more a|
|000000d0| 64 76 61 6e 63 65 64 0d | 0a 65 78 61 6d 70 6c 65 |dvanced.|.example|
|000000e0| 73 29 20 63 61 6e 20 62 | 65 20 66 6f 75 6e 64 20 |s) can b|e found |
|000000f0| 6f 6e 20 74 68 65 20 64 | 69 73 74 72 69 62 75 74 |on the d|istribut|
|00000100| 69 6f 6e 20 64 69 73 63 | 2e 0d 0a 0d 0a 5c 73 65 |ion disc|.....\se|
|00000110| 63 74 69 6f 6e 7b 48 6f | 72 73 65 20 72 61 63 65 |ction{Ho|rse race|
|00000120| 7d 0d 0a 0d 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |}....The| followi|
|00000130| 6e 67 20 70 72 6f 67 72 | 61 6d 20 70 65 72 66 6f |ng progr|am perfo|
|00000140| 72 6d 73 20 61 20 72 61 | 63 65 20 77 69 74 68 20 |rms a ra|ce with |
|00000150| 36 20 68 6f 72 73 65 73 | 2e 20 49 74 20 77 61 73 |6 horses|. It was|
|00000160| 0d 0a 64 65 76 65 6c 6f | 70 65 64 20 62 79 20 70 |..develo|ped by p|
|00000170| 75 70 69 6c 73 20 66 72 | 6f 6d 20 61 20 73 63 68 |upils fr|om a sch|
|00000180| 6f 6f 6c 20 69 6e 20 48 | 75 6e 67 61 72 79 2c 20 |ool in H|ungary, |
|00000190| 75 6e 64 65 72 20 73 75 | 70 65 72 76 69 73 69 6f |under su|pervisio|
|000001a0| 6e 0d 0a 6f 66 20 50 65 | 74 65 72 20 48 61 6e 61 |n..of Pe|ter Hana|
|000001b0| 6b 2e 20 49 74 20 63 6f | 75 6c 64 20 62 65 20 65 |k. It co|uld be e|
|000001c0| 78 74 65 6e 64 65 64 20 | 77 69 74 68 20 61 20 6d |xtended |with a m|
|000001d0| 65 63 68 61 6e 69 73 6d | 20 74 6f 20 61 63 63 65 |echanism| to acce|
|000001e0| 70 74 0d 0a 62 65 74 73 | 2e 20 54 68 65 20 70 72 |pt..bets|. The pr|
|000001f0| 6f 67 72 61 6d 20 6d 61 | 6b 65 73 20 75 73 65 20 |ogram ma|kes use |
|00000200| 6f 66 20 74 68 65 20 7b | 5c 74 74 20 63 75 72 73 |of the {|\tt curs|
|00000210| 6f 72 7d 20 66 75 6e 63 | 74 69 6f 6e 20 74 6f 20 |or} func|tion to |
|00000220| 6f 72 67 61 6e 69 7a 65 | 0d 0a 74 68 65 20 6c 61 |organize|..the la|
|00000230| 79 6f 75 74 20 6f 66 20 | 74 68 65 20 73 63 72 65 |yout of |the scre|
|00000240| 65 6e 2e 20 49 74 20 75 | 73 65 73 20 7b 5c 74 74 |en. It u|ses {\tt|
|00000250| 20 63 68 6f 6f 73 65 31 | 32 38 7d 20 74 6f 20 70 | choose1|28} to p|
|00000260| 72 6f 64 75 63 65 0d 0a | 28 71 75 61 73 69 2d 29 |roduce..|(quasi-)|
|00000270| 72 61 6e 64 6f 6d 20 6e | 75 6d 62 65 72 73 2e 0d |random n|umbers..|
|00000280| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 65 6c 61 6e 7d 0d |...\begi|n{elan}.|
|00000290| 0a 70 72 6f 67 72 61 6d | 20 3a 0d 0a 20 20 73 74 |.program| :.. st|
|000002a0| 61 72 74 20 68 6f 72 73 | 65 73 20 3b 0d 0a 20 20 |art hors|es ;.. |
|000002b0| 52 45 50 0d 0a 20 20 20 | 20 63 68 6f 6f 73 65 20 |REP.. | choose |
|000002c0| 68 6f 72 73 65 20 3b 0d | 0a 20 20 20 20 6d 6f 76 |horse ;.|. mov|
|000002d0| 65 20 68 6f 72 73 65 0d | 0a 20 20 55 4e 54 49 4c |e horse.|. UNTIL|
|000002e0| 0d 0a 20 20 20 20 66 69 | 6e 69 73 68 65 64 0d 0a |.. fi|nished..|
|000002f0| 20 20 45 4e 44 52 45 50 | 20 3b 0d 0a 20 20 64 69 | ENDREP| ;.. di|
|00000300| 73 70 6c 61 79 20 77 69 | 6e 6e 65 72 20 2e 0d 0a |splay wi|nner ...|
|00000310| 0d 0a 73 74 61 72 74 20 | 68 6f 72 73 65 73 20 3a |..start |horses :|
|00000320| 0d 0a 20 20 4c 45 54 20 | 6e 6f 20 6f 66 20 68 6f |.. LET |no of ho|
|00000330| 72 73 65 73 20 3d 20 36 | 20 3b 0d 0a 20 20 4c 45 |rses = 6| ;.. LE|
|00000340| 54 20 73 74 61 72 74 20 | 70 6f 73 20 3d 20 31 32 |T start |pos = 12|
|00000350| 20 3b 0d 0a 20 20 4c 45 | 54 20 65 6e 64 20 70 6f | ;.. LE|T end po|
|00000360| 73 20 3d 20 35 30 20 3b | 0d 0a 20 20 52 4f 57 20 |s = 50 ;|.. ROW |
|00000370| 6e 6f 20 6f 66 20 68 6f | 72 73 65 73 20 49 4e 54 |no of ho|rses INT|
|00000380| 20 56 41 52 20 68 6f 72 | 73 65 20 3b 0d 0a 20 20 | VAR hor|se ;.. |
|00000390| 64 69 73 70 6c 61 79 20 | 74 69 74 6c 65 20 3b 0d |display |title ;.|
|000003a0| 0a 20 20 49 4e 54 20 56 | 41 52 20 69 20 3b 0d 0a |. INT V|AR i ;..|
|000003b0| 20 20 46 4f 52 20 69 20 | 46 52 4f 4d 20 31 20 55 | FOR i |FROM 1 U|
|000003c0| 50 54 4f 20 6e 6f 20 6f | 66 20 68 6f 72 73 65 73 |PTO no o|f horses|
|000003d0| 0d 0a 20 20 52 45 50 0d | 0a 20 20 20 20 70 75 74 |.. REP.|. put|
|000003e0| 20 68 6f 72 73 65 20 61 | 74 20 73 74 61 72 74 70 | horse a|t startp|
|000003f0| 6f 73 20 3b 0d 0a 20 20 | 20 20 6d 61 72 6b 20 73 |os ;.. | mark s|
|00000400| 74 61 72 74 20 6f 66 20 | 74 72 61 63 6b 20 3b 0d |tart of |track ;.|
|00000410| 0a 20 20 20 20 6d 61 72 | 6b 20 65 6e 64 20 6f 66 |. mar|k end of|
|00000420| 20 74 72 61 63 6b 0d 0a | 20 20 45 4e 44 52 45 50 | track..| ENDREP|
|00000430| 20 2e 0d 0a 0d 0a 64 69 | 73 70 6c 61 79 20 74 69 | .....di|splay ti|
|00000440| 74 6c 65 20 3a 0d 0a 20 | 20 63 75 72 73 6f 72 20 |tle :.. | cursor |
|00000450| 28 20 65 6e 64 70 6f 73 | 20 44 49 56 20 32 20 2c |( endpos| DIV 2 ,|
|00000460| 20 31 20 29 20 3b 0d 0a | 20 20 70 75 74 20 28 20 | 1 ) ;..| put ( |
|00000470| 22 48 20 4f 20 52 20 53 | 20 45 20 20 20 52 20 41 |"H O R S| E R A|
|00000480| 20 43 20 45 22 20 29 20 | 2e 0d 0a 0d 0a 70 75 74 | C E" ) |.....put|
|00000490| 20 68 6f 72 73 65 20 61 | 74 20 73 74 61 72 74 70 | horse a|t startp|
|000004a0| 6f 73 20 3a 0d 0a 20 20 | 68 6f 72 73 65 20 5b 20 |os :.. |horse [ |
|000004b0| 69 20 5d 20 3a 3d 20 73 | 74 61 72 74 70 6f 73 20 |i ] := s|tartpos |
|000004c0| 2e 0d 0a 0d 0a 63 68 6f | 6f 73 65 20 68 6f 72 73 |.....cho|ose hors|
|000004d0| 65 20 3a 0d 0a 20 20 49 | 4e 54 20 43 4f 4e 53 54 |e :.. I|NT CONST|
|000004e0| 20 69 78 20 3a 3a 20 28 | 20 63 68 6f 6f 73 65 31 | ix :: (| choose1|
|000004f0| 32 38 20 4d 4f 44 20 6e | 6f 20 6f 66 20 68 6f 72 |28 MOD n|o of hor|
|00000500| 73 65 73 20 29 20 2b 20 | 31 20 2e 0d 0a 0d 0a 6d |ses ) + |1 .....m|
|00000510| 61 72 6b 20 73 74 61 72 | 74 20 6f 66 20 74 72 61 |ark star|t of tra|
|00000520| 63 6b 20 3a 0d 0a 20 20 | 63 75 72 73 6f 72 20 28 |ck :.. |cursor (|
|00000530| 20 31 20 2c 20 32 20 2a | 20 69 20 2b 20 31 20 29 | 1 , 2 *| i + 1 )|
|00000540| 3b 0d 0a 20 20 70 75 74 | 20 28 20 69 20 29 20 3b |;.. put| ( i ) ;|
|00000550| 0d 0a 20 20 70 75 74 20 | 28 20 22 2a 22 20 29 20 |.. put |( "*" ) |
|00000560| 2e 0d 0a 0d 0a 6d 61 72 | 6b 20 65 6e 64 20 6f 66 |.....mar|k end of|
|00000570| 20 74 72 61 63 6b 20 3a | 0d 0a 20 20 63 75 72 73 | track :|.. curs|
|00000580| 6f 72 20 28 20 65 6e 64 | 70 6f 73 20 2c 20 32 20 |or ( end|pos , 2 |
|00000590| 2a 20 69 20 2b 20 31 20 | 29 20 3b 0d 0a 20 20 70 |* i + 1 |) ;.. p|
|000005a0| 75 74 20 28 20 22 7c 22 | 20 29 20 2e 0d 0a 0d 0a |ut ( "|"| ) .....|
|000005b0| 6d 6f 76 65 20 68 6f 72 | 73 65 20 3a 0d 0a 20 20 |move hor|se :.. |
|000005c0| 63 75 72 73 6f 72 20 28 | 20 68 6f 72 73 65 20 5b |cursor (| horse [|
|000005d0| 20 69 78 20 5d 20 2c 20 | 32 20 2a 20 69 78 20 2b | ix ] , |2 * ix +|
|000005e0| 20 31 20 29 20 3b 0d 0a | 20 20 70 75 74 20 28 20 | 1 ) ;..| put ( |
|000005f0| 22 2e 2a 22 20 29 20 3b | 0d 0a 20 20 68 6f 72 73 |".*" ) ;|.. hors|
|00000600| 65 20 5b 20 69 78 20 5d | 20 49 4e 43 52 20 31 20 |e [ ix ]| INCR 1 |
|00000610| 2e 0d 0a 0d 0a 66 69 6e | 69 73 68 65 64 20 3a 0d |.....fin|ished :.|
|00000620| 0a 20 20 68 6f 72 73 65 | 20 5b 20 69 78 20 5d 20 |. horse| [ ix ] |
|00000630| 3e 3d 20 65 6e 64 70 6f | 73 20 2e 0d 0a 0d 0a 64 |>= endpo|s .....d|
|00000640| 69 73 70 6c 61 79 20 77 | 69 6e 6e 65 72 20 3a 0d |isplay w|inner :.|
|00000650| 0a 20 20 63 75 72 73 6f | 72 20 28 20 73 74 61 72 |. curso|r ( star|
|00000660| 74 20 70 6f 73 20 2d 20 | 31 20 2c 20 32 20 2a 20 |t pos - |1 , 2 * |
|00000670| 6e 6f 20 6f 66 20 68 6f | 72 73 65 73 20 2b 20 34 |no of ho|rses + 4|
|00000680| 20 29 20 3b 0d 0a 20 20 | 70 75 74 20 28 20 22 54 | ) ;.. |put ( "T|
|00000690| 68 65 20 77 69 6e 6e 65 | 72 20 69 73 20 68 6f 72 |he winne|r is hor|
|000006a0| 73 65 20 6e 75 6d 62 65 | 72 3a 22 20 29 20 3b 0d |se numbe|r:" ) ;.|
|000006b0| 0a 20 20 70 75 74 20 28 | 20 69 78 20 29 20 3b 0d |. put (| ix ) ;.|
|000006c0| 0a 20 20 6c 69 6e 65 20 | 28 20 32 20 29 20 2e 0d |. line |( 2 ) ..|
|000006d0| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 0d 0a 5c |.\end{el|an}....\|
|000006e0| 73 65 63 74 69 6f 6e 7b | 44 72 61 77 69 6e 67 20 |section{|Drawing |
|000006f0| 61 20 62 6f 78 7d 0d 0a | 0d 0a 54 68 69 73 20 65 |a box}..|..This e|
|00000700| 78 61 6d 70 6c 65 20 69 | 73 20 61 20 73 75 69 74 |xample i|s a suit|
|00000710| 61 62 6c 65 20 64 65 6d | 6f 6e 73 74 72 61 74 69 |able dem|onstrati|
|00000720| 6f 6e 20 66 6f 72 20 54 | 6f 70 2d 44 6f 77 6e 20 |on for T|op-Down |
|00000730| 70 72 6f 67 72 61 6d 6d | 69 6e 67 2e 0d 0a 48 6f |programm|ing...Ho|
|00000740| 77 20 64 6f 65 73 20 6f | 6e 65 20 64 72 61 77 20 |w does o|ne draw |
|00000750| 61 20 62 6f 78 20 6f 6e | 20 61 20 63 6f 6e 76 65 |a box on| a conve|
|00000760| 6e 74 69 6f 6e 61 6c 20 | 73 63 72 65 65 6e 3f 0d |ntional |screen?.|
|00000770| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 65 6c 61 6e 7d 0d |...\begi|n{elan}.|
|00000780| 0a 64 72 61 77 20 62 6f | 78 20 3a 0d 0a 20 20 61 |.draw bo|x :.. a|
|00000790| 73 6b 20 73 69 7a 65 20 | 3b 0d 0a 20 20 64 72 61 |sk size |;.. dra|
|000007a0| 77 20 6c 69 64 20 3b 0d | 0a 20 20 64 72 61 77 20 |w lid ;.|. draw |
|000007b0| 73 69 64 65 73 20 3b 0d | 0a 20 20 64 72 61 77 20 |sides ;.|. draw |
|000007c0| 62 6f 74 74 6f 6d 20 2e | 0d 0a 0d 0a 61 73 6b 20 |bottom .|....ask |
|000007d0| 73 69 7a 65 20 3a 0d 0a | 20 20 49 4e 54 20 56 41 |size :..| INT VA|
|000007e0| 52 20 73 69 7a 65 20 3b | 0d 0a 20 20 6c 69 6e 65 |R size ;|.. line|
|000007f0| 20 3b 0d 0a 20 20 70 75 | 74 20 28 20 22 73 69 7a | ;.. pu|t ( "siz|
|00000800| 65 20 3d 20 22 20 29 20 | 3b 0d 0a 20 20 67 65 74 |e = " ) |;.. get|
|00000810| 20 28 20 73 69 7a 65 20 | 29 20 3b 0d 0a 20 20 6c | ( size |) ;.. l|
|00000820| 69 6e 65 20 28 20 32 20 | 29 20 2e 0d 0a 0d 0a 64 |ine ( 2 |) .....d|
|00000830| 72 61 77 20 6c 69 64 20 | 3a 0d 0a 20 20 70 75 74 |raw lid |:.. put|
|00000840| 20 28 20 73 69 7a 65 20 | 2a 20 73 74 72 69 70 65 | ( size |* stripe|
|00000850| 20 29 20 3b 0d 0a 20 20 | 6c 69 6e 65 20 2e 0d 0a | ) ;.. |line ...|
|00000860| 0d 0a 64 72 61 77 20 73 | 69 64 65 73 20 3a 0d 0a |..draw s|ides :..|
|00000870| 20 20 49 4e 54 20 56 41 | 52 20 69 20 3b 0d 0a 20 | INT VA|R i ;.. |
|00000880| 20 46 4f 52 20 69 20 46 | 52 4f 4d 20 31 20 55 50 | FOR i F|ROM 1 UP|
|00000890| 54 4f 20 73 69 7a 65 0d | 0a 20 20 52 45 50 20 64 |TO size.|. REP d|
|000008a0| 72 61 77 20 73 6c 69 63 | 65 0d 0a 20 20 45 4e 44 |raw slic|e.. END|
|000008b0| 52 45 50 20 2e 0d 0a 0d | 0a 64 72 61 77 20 62 6f |REP ....|.draw bo|
|000008c0| 74 74 6f 6d 20 3a 20 64 | 72 61 77 20 6c 69 64 20 |ttom : d|raw lid |
|000008d0| 2e 0d 0a 0d 0a 73 74 72 | 69 70 65 20 3a 20 22 2d |.....str|ipe : "-|
|000008e0| 2d 22 20 2e 0d 0a 0d 0a | 64 72 61 77 20 73 6c 69 |-" .....|draw sli|
|000008f0| 63 65 20 3a 0d 0a 20 20 | 70 75 74 20 28 20 70 69 |ce :.. |put ( pi|
|00000900| 70 20 29 20 3b 0d 0a 20 | 20 70 75 74 20 28 20 28 |p ) ;.. | put ( (|
|00000910| 20 73 69 7a 65 20 2d 20 | 32 20 29 20 2a 20 62 6c | size - |2 ) * bl|
|00000920| 61 6e 6b 20 29 20 3b 0d | 0a 20 20 70 75 74 20 28 |ank ) ;.|. put (|
|00000930| 20 70 69 70 20 29 20 3b | 0d 0a 20 20 6c 69 6e 65 | pip ) ;|.. line|
|00000940| 20 2e 0d 0a 0d 0a 70 69 | 70 20 3a 20 22 21 21 22 | .....pi|p : "!!"|
|00000950| 20 2e 0d 0a 0d 0a 62 6c | 61 6e 6b 20 3a 20 22 20 | .....bl|ank : " |
|00000960| 22 20 2e 0d 0a 5c 65 6e | 64 7b 65 6c 61 6e 7d 0d |" ...\en|d{elan}.|
|00000970| 0a 0d 0a 5c 73 65 63 74 | 69 6f 6e 7b 43 69 72 63 |...\sect|ion{Circ|
|00000980| 75 6c 61 72 20 73 68 69 | 66 74 69 6e 67 7d 0d 0a |ular shi|fting}..|
|00000990| 0d 0a 54 68 65 20 6f 70 | 65 72 61 74 69 6f 6e 73 |..The op|erations|
|000009a0| 20 6f 6e 20 74 65 78 74 | 73 20 7b 5c 74 74 20 48 | on text|s {\tt H|
|000009b0| 45 41 44 7d 20 61 6e 64 | 20 7b 5c 74 74 20 54 41 |EAD} and| {\tt TA|
|000009c0| 49 4c 7d 20 74 68 61 74 | 20 61 72 65 20 61 76 61 |IL} that| are ava|
|000009d0| 69 6c 61 62 6c 65 0d 0a | 69 6e 20 45 6c 61 6e 2d |ilable..|in Elan-|
|000009e0| 30 20 64 69 66 66 65 72 | 20 6d 61 72 6b 65 64 6c |0 differ| markedl|
|000009f0| 79 20 66 72 6f 6d 20 74 | 68 65 20 73 74 61 6e 64 |y from t|he stand|
|00000a00| 61 72 64 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 69 |ard oper|ations i|
|00000a10| 6e 20 74 68 65 0d 0a 6c | 61 6e 67 75 61 67 65 2c |n the..l|anguage,|
|00000a20| 20 62 65 69 6e 67 20 6d | 75 63 68 20 6d 6f 72 65 | being m|uch more|
|00000a30| 20 6c 69 73 74 2d 6f 72 | 69 65 6e 74 65 64 2e 0d | list-or|iented..|
|00000a40| 0a 49 6e 20 73 74 61 6e | 64 61 72 64 20 45 6c 61 |.In stan|dard Ela|
|00000a50| 6e 20 74 68 65 79 20 63 | 61 6e 20 62 65 20 70 72 |n they c|an be pr|
|00000a60| 6f 67 72 61 6d 6d 65 64 | 20 61 73 0d 0a 0d 0a 5c |ogrammed| as....\|
|00000a70| 62 65 67 69 6e 7b 65 6c | 61 6e 7d 0d 0a 54 45 58 |begin{el|an}..TEX|
|00000a80| 54 20 4f 50 20 48 45 41 | 44 20 28 20 54 45 58 54 |T OP HEA|D ( TEXT|
|00000a90| 20 43 4f 4e 53 54 20 61 | 20 29 20 3a 0d 0a 20 20 | CONST a| ) :.. |
|00000aa0| 61 20 53 55 42 20 31 0d | 0a 45 4e 44 4f 50 20 48 |a SUB 1.|.ENDOP H|
|00000ab0| 45 41 44 20 3b 0d 0a 0d | 0a 54 45 58 54 20 4f 50 |EAD ;...|.TEXT OP|
|00000ac0| 20 54 41 49 4c 20 28 20 | 54 45 58 54 20 43 4f 4e | TAIL ( |TEXT CON|
|00000ad0| 53 54 20 61 20 29 20 3a | 0d 0a 20 20 73 75 62 74 |ST a ) :|.. subt|
|00000ae0| 65 78 74 20 28 20 32 20 | 2c 20 4c 45 4e 47 54 48 |ext ( 2 |, LENGTH|
|00000af0| 20 61 20 2c 20 61 20 29 | 0d 0a 45 4e 44 4f 50 20 | a , a )|..ENDOP |
|00000b00| 54 41 49 4c 20 3b 0d 0a | 5c 65 6e 64 7b 65 6c 61 |TAIL ;..|\end{ela|
|00000b10| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|00000b20| 0a 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 70 |.The fol|lowing p|
|00000b30| 72 6f 67 72 61 6d 20 72 | 65 70 65 61 74 65 64 6c |rogram r|epeatedl|
|00000b40| 79 20 72 6f 74 61 74 65 | 73 20 69 74 73 20 69 6e |y rotate|s its in|
|00000b50| 70 75 74 20 74 65 78 74 | 20 62 79 20 6f 6e 65 0d |put text| by one.|
|00000b60| 0a 70 6f 73 69 74 69 6f | 6e 20 75 6e 74 69 6c 20 |.positio|n until |
|00000b70| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 20 69 73 20 |the orig|inal is |
|00000b80| 6f 62 74 61 69 6e 65 64 | 20 61 67 61 69 6e 2e 0d |obtained| again..|
|00000b90| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 65 6c 61 6e 7d 0d |...\begi|n{elan}.|
|00000ba0| 0a 72 6f 74 61 74 65 20 | 3a 0d 0a 20 20 64 65 63 |.rotate |:.. dec|
|00000bb0| 6c 61 72 65 20 74 65 78 | 74 73 20 3b 0d 0a 20 20 |lare tex|ts ;.. |
|00000bc0| 52 45 50 0d 0a 20 20 20 | 20 73 68 69 66 74 20 73 |REP.. | shift s|
|00000bd0| 20 63 69 72 63 75 6c 61 | 72 6c 79 20 3b 0d 0a 20 | circula|rly ;.. |
|00000be0| 20 20 20 64 69 73 70 6c | 61 79 20 73 0d 0a 20 20 | displ|ay s.. |
|00000bf0| 55 4e 54 49 4c 0d 0a 20 | 20 20 20 73 20 3d 20 6f |UNTIL.. | s = o|
|00000c00| 72 69 67 69 6e 61 6c 0d | 0a 20 20 45 4e 44 52 45 |riginal.|. ENDRE|
|00000c10| 50 20 2e 0d 0a 0d 0a 64 | 65 63 6c 61 72 65 20 74 |P .....d|eclare t|
|00000c20| 65 78 74 73 20 3a 0d 0a | 20 20 54 45 58 54 20 56 |exts :..| TEXT V|
|00000c30| 41 52 20 6f 72 69 67 69 | 6e 61 6c 20 3b 0d 0a 20 |AR origi|nal ;.. |
|00000c40| 20 70 75 74 20 28 20 22 | 54 65 78 74 2c 20 70 6c | put ( "|Text, pl|
|00000c50| 65 61 73 65 3f 22 20 29 | 20 3b 0d 0a 20 20 67 65 |ease?" )| ;.. ge|
|00000c60| 74 20 28 6f 72 69 67 69 | 6e 61 6c 20 29 20 3b 0d |t (origi|nal ) ;.|
|00000c70| 0a 20 20 54 45 58 54 20 | 56 41 52 20 73 20 3a 3a |. TEXT |VAR s ::|
|00000c80| 20 6f 72 69 67 69 6e 61 | 6c 20 2e 0d 0a 0d 0a 64 | origina|l .....d|
|00000c90| 69 73 70 6c 61 79 20 73 | 20 3a 0d 0a 20 20 6c 69 |isplay s| :.. li|
|00000ca0| 6e 65 20 3b 0d 0a 20 20 | 70 75 74 20 28 20 73 20 |ne ;.. |put ( s |
|00000cb0| 29 20 2e 0d 0a 0d 0a 73 | 68 69 66 74 20 73 20 63 |) .....s|hift s c|
|00000cc0| 69 72 63 75 6c 61 72 6c | 79 20 3a 0d 0a 20 20 73 |ircularl|y :.. s|
|00000cd0| 20 3a 3d 20 28 20 54 41 | 49 4c 20 73 20 29 20 2b | := ( TA|IL s ) +|
|00000ce0| 20 28 20 48 45 41 44 20 | 73 20 29 20 2e 0d 0a 5c | ( HEAD |s ) ...\|
|00000cf0| 65 6e 64 7b 65 6c 61 6e | 7d 0d 0a 0d 0a 5c 73 65 |end{elan|}....\se|
|00000d00| 63 74 69 6f 6e 7b 43 6f | 6e 76 65 72 74 69 6e 67 |ction{Co|nverting|
|00000d10| 20 6e 75 6d 62 65 72 73 | 20 69 6e 74 6f 20 74 65 | numbers| into te|
|00000d20| 78 74 73 7d 0d 0a 0d 0a | 44 65 73 69 67 6e 69 6e |xts}....|Designin|
|00000d30| 67 20 61 20 70 72 6f 67 | 72 61 6d 20 66 6f 72 20 |g a prog|ram for |
|00000d40| 63 6f 6e 76 65 72 73 69 | 6f 6e 20 62 65 74 77 65 |conversi|on betwe|
|00000d50| 65 6e 20 6e 75 6d 62 65 | 72 73 20 61 6e 64 20 74 |en numbe|rs and t|
|00000d60| 65 78 74 73 0d 0a 69 73 | 20 61 20 67 6f 6f 64 20 |exts..is| a good |
|00000d70| 77 61 79 20 74 6f 20 67 | 65 74 20 75 73 65 64 20 |way to g|et used |
|00000d80| 74 6f 20 74 68 65 20 72 | 65 73 70 65 63 74 69 76 |to the r|espectiv|
|00000d90| 65 20 70 72 6f 70 65 72 | 74 69 65 73 20 6f 66 20 |e proper|ties of |
|00000da0| 6e 75 6d 62 65 72 73 0d | 0a 61 6e 64 20 74 65 78 |numbers.|.and tex|
|00000db0| 74 73 2e 20 54 68 65 20 | 70 72 6f 67 72 61 6d 20 |ts. The |program |
|00000dc0| 69 6c 6c 75 73 74 72 61 | 74 65 73 20 74 68 65 20 |illustra|tes the |
|00000dd0| 75 73 65 20 6f 66 20 7b | 5c 74 74 20 43 41 54 7d |use of {|\tt CAT}|
|00000de0| 20 61 6e 64 20 7b 5c 74 | 74 20 53 55 42 7d 2e 0d | and {\t|t SUB}..|
|00000df0| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 65 6c 61 6e 7d 0d |...\begi|n{elan}.|
|00000e00| 0a 6f 75 74 69 6e 74 20 | 3a 0d 0a 20 20 70 75 74 |.outint |:.. put|
|00000e10| 20 28 20 22 54 68 69 73 | 20 70 72 6f 67 72 61 6d | ( "This| program|
|00000e20| 20 63 6f 6e 76 65 72 74 | 73 20 61 20 70 6f 73 69 | convert|s a posi|
|00000e30| 74 69 76 65 20 69 6e 74 | 65 67 65 72 22 20 29 20 |tive int|eger" ) |
|00000e40| 3b 0d 0a 20 20 6c 69 6e | 65 20 3b 0d 0a 20 20 70 |;.. lin|e ;.. p|
|00000e50| 75 74 20 28 20 22 74 6f | 20 61 20 67 69 76 65 6e |ut ( "to| a given|
|00000e60| 20 72 61 64 69 78 20 69 | 6e 20 72 61 6e 67 65 20 | radix i|n range |
|00000e70| 31 20 74 6f 20 31 36 2e | 22 20 29 20 3b 0d 0a 20 |1 to 16.|" ) ;.. |
|00000e80| 20 6c 69 6e 65 20 3b 0d | 0a 20 20 61 73 6b 20 66 | line ;.|. ask f|
|00000e90| 6f 72 20 72 61 64 69 78 | 20 3b 0d 0a 20 20 57 48 |or radix| ;.. WH|
|00000ea0| 49 4c 45 0d 0a 20 20 20 | 20 61 6e 6f 74 68 65 72 |ILE.. | another|
|00000eb0| 20 6e 75 6d 62 65 72 20 | 3b 0d 0a 20 20 52 45 50 | number |;.. REP|
|00000ec0| 0d 0a 20 20 20 20 72 65 | 70 72 65 73 65 6e 74 20 |.. re|present |
|00000ed0| 6e 75 6d 62 65 72 20 61 | 63 63 6f 72 64 69 6e 67 |number a|ccording|
|00000ee0| 20 74 6f 20 72 61 64 69 | 78 20 3b 0d 0a 20 20 20 | to radi|x ;.. |
|00000ef0| 20 70 72 69 6e 74 20 72 | 65 70 72 65 73 65 6e 74 | print r|epresent|
|00000f00| 61 74 69 6f 6e 0d 0a 20 | 20 45 4e 44 52 45 50 2e |ation.. | ENDREP.|
|00000f10| 0d 0a 0d 0a 61 73 6b 20 | 66 6f 72 20 72 61 64 69 |....ask |for radi|
|00000f20| 78 20 3a 0d 0a 20 20 49 | 4e 54 20 56 41 52 20 72 |x :.. I|NT VAR r|
|00000f30| 61 64 69 78 20 3b 0d 0a | 20 20 70 75 74 20 28 20 |adix ;..| put ( |
|00000f40| 22 52 61 64 69 78 2c 20 | 70 6c 65 61 73 65 3a 22 |"Radix, |please:"|
|00000f50| 20 29 20 3b 0d 0a 20 20 | 67 65 74 20 28 20 72 61 | ) ;.. |get ( ra|
|00000f60| 64 69 78 20 29 20 3b 0d | 0a 20 20 6c 69 6e 65 20 |dix ) ;.|. line |
|00000f70| 2e 0d 0a 0d 0a 61 6e 6f | 74 68 65 72 20 6e 75 6d |.....ano|ther num|
|00000f80| 62 65 72 20 3a 0d 0a 20 | 20 61 73 6b 20 66 6f 72 |ber :.. | ask for|
|00000f90| 20 6e 75 6d 62 65 72 20 | 3b 0d 0a 20 20 6e 75 6d | number |;.. num|
|00000fa0| 62 65 72 20 3e 20 30 20 | 2e 0d 0a 0d 0a 61 73 6b |ber > 0 |.....ask|
|00000fb0| 20 66 6f 72 20 6e 75 6d | 62 65 72 20 3a 0d 0a 20 | for num|ber :.. |
|00000fc0| 20 49 4e 54 20 56 41 52 | 20 6e 75 6d 62 65 72 20 | INT VAR| number |
|00000fd0| 3b 0d 0a 20 20 70 75 74 | 20 28 20 22 6e 75 6d 62 |;.. put| ( "numb|
|00000fe0| 65 72 2c 20 70 6c 65 61 | 73 65 3a 22 20 29 20 3b |er, plea|se:" ) ;|
|00000ff0| 0d 0a 20 20 67 65 74 20 | 28 20 6e 75 6d 62 65 72 |.. get |( number|
|00001000| 20 29 20 3b 0d 0a 20 20 | 6c 69 6e 65 20 2e 0d 0a | ) ;.. |line ...|
|00001010| 0d 0a 72 65 70 72 65 73 | 65 6e 74 20 6e 75 6d 62 |..repres|ent numb|
|00001020| 65 72 20 61 63 63 6f 72 | 64 69 6e 67 20 74 6f 20 |er accor|ding to |
|00001030| 72 61 64 69 78 20 3a 0d | 0a 20 20 54 45 58 54 20 |radix :.|. TEXT |
|00001040| 56 41 52 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |VAR repr|esentati|
|00001050| 6f 6e 20 3a 3a 20 22 22 | 20 3b 0d 0a 20 20 52 45 |on :: ""| ;.. RE|
|00001060| 50 0d 0a 20 20 20 20 69 | 73 6f 6c 61 74 65 20 61 |P.. i|solate a|
|00001070| 20 64 69 67 69 74 20 3b | 0d 0a 20 20 20 20 61 64 | digit ;|.. ad|
|00001080| 64 20 74 68 69 73 20 64 | 69 67 69 74 20 74 6f 20 |d this d|igit to |
|00001090| 74 68 65 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |the repr|esentati|
|000010a0| 6f 6e 0d 0a 20 20 55 4e | 54 49 4c 0d 0a 20 20 20 |on.. UN|TIL.. |
|000010b0| 20 6e 6f 20 6d 6f 72 65 | 20 64 69 67 69 74 73 0d | no more| digits.|
|000010c0| 0a 20 20 45 4e 44 52 45 | 50 20 2e 0d 0a 0d 0a 69 |. ENDRE|P .....i|
|000010d0| 73 6f 6c 61 74 65 20 61 | 20 64 69 67 69 74 20 3a |solate a| digit :|
|000010e0| 0d 0a 20 20 49 4e 54 20 | 43 4f 4e 53 54 20 64 69 |.. INT |CONST di|
|000010f0| 67 69 74 20 3a 3a 20 6e | 75 6d 62 65 72 20 4d 4f |git :: n|umber MO|
|00001100| 44 20 72 61 64 69 78 20 | 3b 0d 0a 20 20 6e 75 6d |D radix |;.. num|
|00001110| 62 65 72 20 3a 3d 20 6e | 75 6d 62 65 72 20 44 49 |ber := n|umber DI|
|00001120| 56 20 72 61 64 69 78 20 | 2e 0d 0a 0d 0a 61 64 64 |V radix |.....add|
|00001130| 20 74 68 69 73 20 64 69 | 67 69 74 20 74 6f 20 74 | this di|git to t|
|00001140| 68 65 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f |he repre|sentatio|
|00001150| 6e 20 3a 0d 0a 20 20 72 | 65 70 72 65 73 65 6e 74 |n :.. r|epresent|
|00001160| 61 74 69 6f 6e 20 3a 3d | 20 72 65 70 72 65 73 65 |ation :=| represe|
|00001170| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 64 69 67 69 74 |ntation |of digit|
|00001180| 20 2b 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f | + repre|sentatio|
|00001190| 6e 20 2e 0d 0a 0d 0a 6e | 6f 20 6d 6f 72 65 20 64 |n .....n|o more d|
|000011a0| 69 67 69 74 73 20 3a 0d | 0a 20 20 6e 75 6d 62 65 |igits :.|. numbe|
|000011b0| 72 20 3d 20 30 20 2e 0d | 0a 0d 0a 72 65 70 72 65 |r = 0 ..|...repre|
|000011c0| 73 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 64 69 67 |sentatio|n of dig|
|000011d0| 69 74 20 3a 0d 0a 20 20 | 20 49 46 20 64 69 67 69 |it :.. | IF digi|
|000011e0| 74 20 3e 20 31 35 0d 0a | 20 20 20 54 48 45 4e 20 |t > 15..| THEN |
|000011f0| 22 3f 22 0d 0a 20 20 20 | 45 4c 53 45 20 22 30 31 |"?".. |ELSE "01|
|00001200| 32 33 34 35 36 37 38 39 | 41 42 43 44 45 46 22 20 |23456789|ABCDEF" |
|00001210| 53 55 42 20 28 20 64 69 | 67 69 74 20 2b 20 31 20 |SUB ( di|git + 1 |
|00001220| 29 0d 0a 20 20 20 46 49 | 20 2e 0d 0a 0d 0a 70 72 |).. FI| .....pr|
|00001230| 69 6e 74 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |int repr|esentati|
|00001240| 6f 6e 20 3a 0d 0a 20 20 | 20 20 70 75 74 20 28 20 |on :.. | put ( |
|00001250| 22 52 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 20 |"Represe|ntation |
|00001260| 3d 20 22 20 29 20 3b 0d | 0a 20 20 20 20 70 75 74 |= " ) ;.|. put|
|00001270| 20 28 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f | ( repre|sentatio|
|00001280| 6e 20 29 20 3b 0d 0a 20 | 20 20 20 6c 69 6e 65 20 |n ) ;.. | line |
|00001290| 2e 0d 0a 5c 65 6e 64 7b | 65 6c 61 6e 7d 0d 0a 0d |...\end{|elan}...|
|000012a0| 0a 5c 73 65 63 74 69 6f | 6e 7b 47 75 65 73 73 69 |.\sectio|n{Guessi|
|000012b0| 6e 67 20 6e 75 6d 62 65 | 72 73 7d 0d 0a 0d 0a 54 |ng numbe|rs}....T|
|000012c0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 65 78 61 |he follo|wing exa|
|000012d0| 6d 70 6c 65 20 69 73 20 | 64 75 65 20 74 6f 20 4c |mple is |due to L|
|000012e0| 65 6f 20 47 65 75 72 74 | 73 20 28 43 65 6e 74 72 |eo Geurt|s (Centr|
|000012f0| 75 6d 20 76 6f 6f 72 20 | 57 69 73 6b 75 6e 64 65 |um voor |Wiskunde|
|00001300| 0d 0a 65 6e 20 49 6e 66 | 6f 72 6d 61 74 69 63 61 |..en Inf|ormatica|
|00001310| 2c 20 41 6d 73 74 65 72 | 64 61 6d 29 2e 20 42 79 |, Amster|dam). By|
|00001320| 20 6d 65 61 6e 73 20 6f | 66 20 74 68 65 20 68 61 | means o|f the ha|
|00001330| 6c 76 69 6e 67 20 61 6c | 67 6f 72 69 74 68 6d 0d |lving al|gorithm.|
|00001340| 0a 69 74 20 67 75 65 73 | 73 65 73 20 61 20 6e 75 |.it gues|ses a nu|
|00001350| 6d 62 65 72 20 63 68 6f | 73 65 6e 20 62 79 20 74 |mber cho|sen by t|
|00001360| 68 65 20 68 75 6d 61 6e | 20 6f 70 70 6f 6e 65 6e |he human| opponen|
|00001370| 74 2e 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 65 6c 61 |t.....\b|egin{ela|
|00001380| 6e 7d 0d 0a 68 6f 77 20 | 74 6f 20 70 6c 61 79 20 |n}..how |to play |
|00001390| 3a 0d 0a 20 20 74 65 6c | 6c 20 74 68 65 20 72 75 |:.. tel|l the ru|
|000013a0| 6c 65 73 20 3b 0d 0a 20 | 20 61 6c 6c 20 6e 75 6d |les ;.. | all num|
|000013b0| 62 65 72 73 20 30 20 74 | 6f 20 39 39 20 61 72 65 |bers 0 t|o 99 are|
|000013c0| 20 70 6f 73 73 69 62 6c | 65 20 3b 0d 0a 20 20 52 | possibl|e ;.. R|
|000013d0| 45 50 0d 0a 20 20 20 20 | 6d 61 6b 65 20 61 20 67 |EP.. |make a g|
|000013e0| 75 65 73 73 20 3b 0d 0a | 20 20 20 20 77 61 69 74 |uess ;..| wait|
|000013f0| 20 66 6f 72 20 72 65 70 | 6c 79 20 3b 0d 0a 20 20 | for rep|ly ;.. |
|00001400| 20 20 68 61 6c 76 65 20 | 74 68 65 20 72 61 6e 67 | halve |the rang|
|00001410| 65 0d 0a 20 20 55 4e 54 | 49 4c 0d 0a 20 20 20 20 |e.. UNT|IL.. |
|00001420| 67 6f 6f 64 20 4f 52 20 | 69 6d 70 6f 73 73 69 62 |good OR |impossib|
|00001430| 6c 65 0d 0a 20 20 45 4e | 44 52 45 50 20 3b 0d 0a |le.. EN|DREP ;..|
|00001440| 20 20 74 65 6c 6c 20 72 | 65 73 75 6c 74 20 2e 0d | tell r|esult ..|
|00001450| 0a 0d 0a 74 65 6c 6c 20 | 74 68 65 20 72 75 6c 65 |...tell |the rule|
|00001460| 73 20 3a 0d 0a 20 20 70 | 75 74 20 28 20 22 54 68 |s :.. p|ut ( "Th|
|00001470| 69 6e 6b 20 6f 66 20 61 | 20 6e 75 6d 62 65 72 20 |ink of a| number |
|00001480| 66 72 6f 6d 20 30 20 74 | 6f 20 39 39 2e 22 20 29 |from 0 t|o 99." )|
|00001490| 20 2e 0d 0a 0d 0a 77 61 | 69 74 20 66 6f 72 20 72 | .....wa|it for r|
|000014a0| 65 70 6c 79 20 3a 0d 0a | 20 20 54 45 58 54 20 56 |eply :..| TEXT V|
|000014b0| 41 52 20 72 65 70 6c 79 | 20 3b 0d 0a 20 20 67 65 |AR reply| ;.. ge|
|000014c0| 74 20 28 20 72 65 70 6c | 79 20 29 20 3b 0d 0a 20 |t ( repl|y ) ;.. |
|000014d0| 20 57 48 49 4c 45 20 72 | 65 70 6c 79 20 3c 3e 20 | WHILE r|eply <> |
|000014e0| 22 79 22 20 41 4e 44 20 | 72 65 70 6c 79 20 3c 3e |"y" AND |reply <>|
|000014f0| 20 22 68 22 20 41 4e 44 | 20 72 65 70 6c 79 20 3c | "h" AND| reply <|
|00001500| 3e 20 22 6c 22 0d 0a 20 | 20 52 45 50 0d 0a 20 20 |> "l".. | REP.. |
|00001510| 20 20 6c 69 6e 65 20 3b | 0d 0a 20 20 20 20 70 75 | line ;|.. pu|
|00001520| 74 20 28 20 22 50 6f 73 | 73 69 62 6c 65 20 61 6e |t ( "Pos|sible an|
|00001530| 73 77 65 72 73 20 61 72 | 65 20 79 28 65 73 29 2c |swers ar|e y(es),|
|00001540| 20 68 28 69 67 68 29 2c | 20 6c 28 6f 77 29 22 20 | h(igh),| l(ow)" |
|00001550| 29 20 3b 0d 0a 20 20 20 | 20 67 65 74 20 28 20 72 |) ;.. | get ( r|
|00001560| 65 70 6c 79 20 29 0d 0a | 20 20 45 4e 44 52 45 50 |eply )..| ENDREP|
|00001570| 20 2e 0d 0a 0d 0a 68 61 | 6c 76 65 20 74 68 65 20 | .....ha|lve the |
|00001580| 72 61 6e 67 65 20 3a 0d | 0a 20 20 49 46 20 72 65 |range :.|. IF re|
|00001590| 70 6c 79 20 3d 20 22 6c | 22 0d 0a 20 20 54 48 45 |ply = "l|".. THE|
|000015a0| 4e 0d 0a 20 20 20 20 6d | 69 6e 20 3a 3d 20 67 75 |N.. m|in := gu|
|000015b0| 65 73 73 20 2b 20 31 0d | 0a 20 20 45 4c 49 46 20 |ess + 1.|. ELIF |
|000015c0| 72 65 70 6c 79 20 3d 20 | 22 68 22 0d 0a 20 20 54 |reply = |"h".. T|
|000015d0| 48 45 4e 0d 0a 20 20 20 | 20 6d 61 78 20 3a 3d 20 |HEN.. | max := |
|000015e0| 67 75 65 73 73 20 2d 20 | 31 0d 0a 20 20 46 49 20 |guess - |1.. FI |
|000015f0| 2e 0d 0a 0d 0a 67 6f 6f | 64 20 3a 0d 0a 20 20 72 |.....goo|d :.. r|
|00001600| 65 70 6c 79 20 3d 20 22 | 79 22 20 2e 0d 0a 0d 0a |eply = "|y" .....|
|00001610| 69 6d 70 6f 73 73 69 62 | 6c 65 20 3a 0d 0a 20 20 |impossib|le :.. |
|00001620| 6d 69 6e 20 3e 20 6d 61 | 78 20 2e 0d 0a 0d 0a 61 |min > ma|x .....a|
|00001630| 6c 6c 20 6e 75 6d 62 65 | 72 73 20 30 20 74 6f 20 |ll numbe|rs 0 to |
|00001640| 39 39 20 61 72 65 20 70 | 6f 73 73 69 62 6c 65 20 |99 are p|ossible |
|00001650| 3a 0d 0a 20 20 49 4e 54 | 20 56 41 52 20 6d 69 6e |:.. INT| VAR min|
|00001660| 20 3a 3a 20 30 20 3b 0d | 0a 20 20 49 4e 54 20 56 | :: 0 ;.|. INT V|
|00001670| 41 52 20 6d 61 78 20 3a | 3a 20 39 39 20 2e 0d 0a |AR max :|: 99 ...|
|00001680| 0d 0a 6d 61 6b 65 20 61 | 20 67 75 65 73 73 20 3a |..make a| guess :|
|00001690| 0d 0a 20 20 49 4e 54 20 | 43 4f 4e 53 54 20 67 75 |.. INT |CONST gu|
|000016a0| 65 73 73 20 3a 3a 20 28 | 20 6d 69 6e 20 2b 20 6d |ess :: (| min + m|
|000016b0| 61 78 20 29 20 44 49 56 | 20 32 20 3b 0d 0a 20 20 |ax ) DIV| 2 ;.. |
|000016c0| 6c 69 6e 65 20 3b 0d 0a | 20 20 70 75 74 20 28 20 |line ;..| put ( |
|000016d0| 22 49 73 20 69 74 22 20 | 29 20 3b 0d 0a 20 20 70 |"Is it" |) ;.. p|
|000016e0| 75 74 20 28 20 67 75 65 | 73 73 20 29 20 3b 0d 0a |ut ( gue|ss ) ;..|
|000016f0| 20 20 70 75 74 20 28 20 | 22 3f 22 20 29 20 2e 0d | put ( |"?" ) ..|
|00001700| 0a 0d 0a 20 74 65 6c 6c | 20 72 65 73 75 6c 74 20 |... tell| result |
|00001710| 3a 0d 0a 20 20 6c 69 6e | 65 20 3b 0d 0a 20 20 49 |:.. lin|e ;.. I|
|00001720| 46 20 67 6f 6f 64 0d 0a | 20 20 54 48 45 4e 0d 0a |F good..| THEN..|
|00001730| 20 20 20 20 70 75 74 20 | 28 20 22 47 6f 6f 64 21 | put |( "Good!|
|00001740| 22 20 29 0d 0a 20 20 45 | 4c 53 45 0d 0a 20 20 20 |" ).. E|LSE.. |
|00001750| 20 70 75 74 20 28 20 22 | 43 68 65 61 74 21 22 20 | put ( "|Cheat!" |
|00001760| 29 0d 0a 20 20 46 49 20 | 2e 0d 0a 5c 65 6e 64 7b |).. FI |...\end{|
|00001770| 65 6c 61 6e 7d 0d 0a 0d | 0a 5c 73 65 63 74 69 6f |elan}...|.\sectio|
|00001780| 6e 7b 47 75 65 73 73 20 | 6d 79 20 61 67 65 7d 0d |n{Guess |my age}.|
|00001790| 0a 0d 0a 54 68 69 73 20 | 65 78 61 6d 70 6c 65 20 |...This |example |
|000017a0| 69 73 20 61 6c 73 6f 20 | 64 75 65 20 74 6f 20 4c |is also |due to L|
|000017b0| 65 6f 20 47 65 75 72 74 | 73 2e 20 54 68 69 73 20 |eo Geurt|s. This |
|000017c0| 74 69 6d 65 20 74 68 65 | 20 70 6c 61 79 65 72 0d |time the| player.|
|000017d0| 0a 68 61 73 20 74 6f 20 | 67 75 65 73 73 20 61 20 |.has to |guess a |
|000017e0| 72 61 6e 64 6f 6d 6c 79 | 20 63 68 6f 73 65 6e 20 |randomly| chosen |
|000017f0| 60 60 61 67 65 27 27 20 | 49 74 20 69 73 20 61 20 |``age'' |It is a |
|00001800| 67 6f 6f 64 20 6f 70 70 | 6f 72 74 75 6e 69 74 79 |good opp|ortunity|
|00001810| 0d 0a 74 6f 20 6c 65 61 | 72 6e 2c 20 62 79 20 65 |..to lea|rn, by e|
|00001820| 78 70 65 72 69 6d 65 6e | 74 2c 20 74 68 65 20 76 |xperimen|t, the v|
|00001830| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 68 61 6c 76 |alue of |the halv|
|00001840| 69 6e 67 20 61 6c 67 6f | 72 69 74 68 6d 2e 0d 0a |ing algo|rithm...|
|00001850| 0d 0a 5c 62 65 67 69 6e | 7b 65 6c 61 6e 7d 0d 0a |..\begin|{elan}..|
|00001860| 68 6f 77 20 74 6f 20 67 | 75 65 73 73 20 3a 0d 0a |how to g|uess :..|
|00001870| 20 20 63 68 6f 6f 73 65 | 20 61 20 6e 75 6d 62 65 | choose| a numbe|
|00001880| 72 20 3b 0d 0a 20 20 6c | 6f 6f 6b 20 66 6f 72 20 |r ;.. l|ook for |
|00001890| 61 20 63 75 73 74 6f 6d | 65 72 20 3b 0d 0a 20 20 |a custom|er ;.. |
|000018a0| 6c 65 74 20 68 69 6d 20 | 67 75 65 73 73 20 3b 0d |let him |guess ;.|
|000018b0| 0a 20 20 57 48 49 4c 45 | 20 6e 6f 74 20 67 75 65 |. WHILE| not gue|
|000018c0| 73 73 65 64 0d 0a 20 20 | 52 45 50 0d 0a 20 20 20 |ssed.. |REP.. |
|000018d0| 20 67 69 76 65 20 61 20 | 68 69 6e 74 20 3b 0d 0a | give a |hint ;..|
|000018e0| 20 20 20 20 61 6e 6f 74 | 68 65 72 20 67 75 65 73 | anot|her gues|
|000018f0| 73 0d 0a 20 20 45 4e 44 | 52 45 50 20 3b 0d 0a 20 |s.. END|REP ;.. |
|00001900| 20 61 70 70 6c 61 75 73 | 65 20 2e 0d 0a 0d 0a 63 | applaus|e .....c|
|00001910| 68 6f 6f 73 65 20 61 20 | 6e 75 6d 62 65 72 20 3a |hoose a |number :|
|00001920| 0d 0a 20 20 49 4e 54 20 | 56 41 52 20 6e 75 6d 62 |.. INT |VAR numb|
|00001930| 65 72 20 3a 3a 20 63 68 | 6f 6f 73 65 31 32 38 20 |er :: ch|oose128 |
|00001940| 2e 0d 0a 0d 0a 6c 6f 6f | 6b 20 66 6f 72 20 61 20 |.....loo|k for a |
|00001950| 63 75 73 74 6f 6d 65 72 | 20 3a 0d 0a 20 20 70 75 |customer| :.. pu|
|00001960| 74 20 28 20 22 47 75 65 | 73 73 20 6d 79 20 61 67 |t ( "Gue|ss my ag|
|00001970| 65 20 22 20 29 20 2e 0d | 0a 0d 0a 6c 65 74 20 68 |e " ) ..|...let h|
|00001980| 69 6d 20 67 75 65 73 73 | 20 3a 0d 0a 20 20 49 4e |im guess| :.. IN|
|00001990| 54 20 56 41 52 20 67 75 | 65 73 73 20 3b 0d 0a 20 |T VAR gu|ess ;.. |
|000019a0| 20 67 65 74 20 28 20 67 | 75 65 73 73 20 29 20 2e | get ( g|uess ) .|
|000019b0| 0d 0a 0d 0a 6e 6f 74 20 | 67 75 65 73 73 65 64 20 |....not |guessed |
|000019c0| 3a 0d 0a 20 20 67 75 65 | 73 73 20 3c 3e 20 6e 75 |:.. gue|ss <> nu|
|000019d0| 6d 62 65 72 20 2e 0d 0a | 0d 0a 67 69 76 65 20 61 |mber ...|..give a|
|000019e0| 20 68 69 6e 74 20 3a 0d | 0a 20 20 6c 69 6e 65 20 | hint :.|. line |
|000019f0| 3b 0d 0a 20 20 49 46 20 | 67 75 65 73 73 20 3e 20 |;.. IF |guess > |
|00001a00| 6e 75 6d 62 65 72 0d 0a | 20 20 54 48 45 4e 0d 0a |number..| THEN..|
|00001a10| 20 20 20 20 70 75 74 20 | 28 20 22 54 6f 6f 20 68 | put |( "Too h|
|00001a20| 69 67 68 2c 20 74 72 79 | 20 61 67 61 69 6e 20 22 |igh, try| again "|
|00001a30| 20 29 0d 0a 20 20 45 4c | 53 45 0d 0a 20 20 20 20 | ).. EL|SE.. |
|00001a40| 70 75 74 20 28 20 22 54 | 6f 6f 20 6c 6f 77 2c 20 |put ( "T|oo low, |
|00001a50| 74 72 79 20 61 67 61 69 | 6e 20 20 22 20 29 0d 0a |try agai|n " )..|
|00001a60| 20 20 46 49 20 2e 0d 0a | 0d 0a 61 6e 6f 74 68 65 | FI ...|..anothe|
|00001a70| 72 20 67 75 65 73 73 20 | 3a 0d 0a 20 20 67 65 74 |r guess |:.. get|
|00001a80| 20 28 20 67 75 65 73 73 | 20 29 20 2e 0d 0a 0d 0a | ( guess| ) .....|
|00001a90| 61 70 70 6c 61 75 73 65 | 20 3a 0d 0a 20 20 6c 69 |applause| :.. li|
|00001aa0| 6e 65 20 3b 0d 0a 20 20 | 70 75 74 20 28 20 22 43 |ne ;.. |put ( "C|
|00001ab0| 6f 72 72 65 63 74 21 22 | 20 29 20 3b 0d 0a 20 20 |orrect!"| ) ;.. |
|00001ac0| 6c 69 6e 65 20 28 20 33 | 20 29 20 2e 0d 0a 5c 65 |line ( 3| ) ...\e|
|00001ad0| 6e 64 7b 65 6c 61 6e 7d | 0d 0a 0d 0a 5c 73 65 63 |nd{elan}|....\sec|
|00001ae0| 74 69 6f 6e 7b 4b 61 72 | 65 6c 20 74 68 65 20 52 |tion{Kar|el the R|
|00001af0| 6f 62 6f 74 7d 0d 0a 0d | 0a 49 6e 20 61 6e 20 69 |obot}...|.In an i|
|00001b00| 6e 74 72 6f 64 75 63 74 | 6f 72 79 20 70 72 6f 67 |ntroduct|ory prog|
|00001b10| 72 61 6d 6d 69 6e 67 20 | 63 6f 75 72 73 65 2c 20 |ramming |course, |
|00001b20| 69 74 20 69 73 20 67 6f | 6f 64 20 70 72 61 63 74 |it is go|od pract|
|00001b30| 69 63 65 20 74 6f 0d 0a | 6d 61 6b 65 20 75 73 65 |ice to..|make use|
|00001b40| 20 6f 66 20 61 20 72 65 | 73 74 72 69 63 74 65 64 | of a re|stricted|
|00001b50| 20 61 6e 64 20 70 72 6f | 74 65 63 74 65 64 20 70 | and pro|tected p|
|00001b60| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 65 6e 76 69 72 |rogrammi|ng envir|
|00001b70| 6f 6e 6d 65 6e 74 0d 0a | 77 69 74 68 69 6e 20 77 |onment..|within w|
|00001b80| 68 69 63 68 20 74 68 65 | 20 70 75 70 69 6c 73 20 |hich the| pupils |
|00001b90| 63 61 6e 20 64 65 76 65 | 6c 6f 70 20 74 68 65 69 |can deve|lop thei|
|00001ba0| 72 20 66 69 72 73 74 20 | 70 72 6f 67 72 61 6d 73 |r first |programs|
|00001bb0| 2e 20 57 65 0d 0a 77 69 | 6c 6c 20 64 65 73 63 72 |. We..wi|ll descr|
|00001bc0| 69 62 65 20 68 65 72 65 | 20 4b 61 72 65 6c 20 74 |ibe here| Karel t|
|00001bd0| 68 65 20 52 6f 62 6f 74 | 2c 20 61 20 64 69 64 61 |he Robot|, a dida|
|00001be0| 63 74 69 63 20 61 69 64 | 20 62 61 73 65 64 20 6f |ctic aid| based o|
|00001bf0| 6e 0d 0a 0d 0a 5c 62 65 | 67 69 6e 7b 6c 69 74 65 |n....\be|gin{lite|
|00001c00| 72 61 6c 7d 20 0d 0a 20 | 20 52 2e 45 2e 20 50 61 |ral} .. | R.E. Pa|
|00001c10| 74 74 69 73 2c 0d 0a 20 | 20 4b 61 72 65 6c 20 74 |ttis,.. | Karel t|
|00001c20| 68 65 20 52 6f 62 6f 74 | 2c 0d 0a 20 20 61 20 67 |he Robot|,.. a g|
|00001c30| 65 6e 74 6c 65 20 69 6e | 74 72 6f 64 75 63 74 69 |entle in|troducti|
|00001c40| 6f 6e 20 74 6f 20 74 68 | 65 20 61 72 74 20 6f 66 |on to th|e art of|
|00001c50| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 2c 0d 0a 20 | program|ming,.. |
|00001c60| 20 4a 6f 68 6e 20 57 69 | 6c 65 79 20 61 6e 64 20 | John Wi|ley and |
|00001c70| 73 6f 6e 73 2c 20 31 39 | 38 31 2e 0d 0a 5c 65 6e |sons, 19|81...\en|
|00001c80| 64 7b 6c 69 74 65 72 61 | 6c 7d 20 0d 0a 0d 0a 5c |d{litera|l} ....\|
|00001c90| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 49 74 73 20 70 75 |noindent|..Its pu|
|00001ca0| 72 70 6f 73 65 20 69 73 | 20 74 6f 20 63 6f 6e 66 |rpose is| to conf|
|00001cb0| 72 6f 6e 74 20 61 20 70 | 75 70 69 6c 20 77 69 74 |ront a p|upil wit|
|00001cc0| 68 20 74 68 65 20 65 73 | 73 65 6e 74 69 61 6c 20 |h the es|sential |
|00001cd0| 69 6e 67 72 65 64 69 65 | 6e 74 73 0d 0a 6f 66 20 |ingredie|nts..of |
|00001ce0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 6c 61 6e 67 |programm|ing lang|
|00001cf0| 75 61 67 65 73 3a 20 61 | 63 74 69 6f 6e 73 2c 20 |uages: a|ctions, |
|00001d00| 74 65 73 74 73 2c 20 63 | 6f 6e 74 72 6f 6c 20 73 |tests, c|ontrol s|
|00001d10| 74 72 75 63 74 75 72 65 | 73 0d 0a 61 6e 64 20 72 |tructure|s..and r|
|00001d20| 65 66 69 6e 65 6d 65 6e | 74 73 2c 20 77 69 74 68 |efinemen|ts, with|
|00001d30| 6f 75 74 20 68 61 76 69 | 6e 67 20 74 6f 20 69 6e |out havi|ng to in|
|00001d40| 74 72 6f 64 75 63 65 20 | 73 75 63 68 20 63 6f 6d |troduce |such com|
|00001d50| 70 6c 69 63 61 74 65 64 | 0d 0a 63 6f 6e 63 65 70 |plicated|..concep|
|00001d60| 74 73 20 61 73 20 76 61 | 72 69 61 62 6c 65 73 2c |ts as va|riables,|
|00001d70| 20 6f 62 6a 65 63 74 73 | 2c 20 76 61 6c 75 65 73 | objects|, values|
|00001d80| 20 61 6e 64 20 74 79 70 | 65 73 2e 0d 0a 0d 0a 57 | and typ|es.....W|
|00001d90| 69 74 68 20 74 68 65 20 | 45 6c 61 6e 20 50 72 6f |ith the |Elan Pro|
|00001da0| 67 72 61 6d 6d 69 6e 67 | 20 45 6e 76 69 72 6f 6e |gramming| Environ|
|00001db0| 6d 65 6e 74 2c 20 61 20 | 7b 5c 65 6d 20 73 74 61 |ment, a |{\em sta|
|00001dc0| 6e 64 61 72 64 20 70 61 | 63 6b 65 74 7d 0d 0a 66 |ndard pa|cket}..f|
|00001dd0| 6f 72 20 4b 61 72 65 6c | 20 74 68 65 20 52 6f 62 |or Karel| the Rob|
|00001de0| 6f 74 20 69 73 20 69 6e | 63 6c 75 64 65 64 2e 0d |ot is in|cluded..|
|00001df0| 0a 0d 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 54 |...\subs|ection{T|
|00001e00| 68 65 20 77 6f 72 6c 64 | 20 6f 66 20 4b 61 72 65 |he world| of Kare|
|00001e10| 6c 7d 0d 0a 0d 0a 4b 61 | 72 65 6c 20 73 70 65 6e |l}....Ka|rel spen|
|00001e20| 64 73 20 68 69 73 20 6c | 69 66 65 20 6f 6e 20 74 |ds his l|ife on t|
|00001e30| 68 65 20 63 6f 72 6e 65 | 72 73 20 6f 66 20 73 74 |he corne|rs of st|
|00001e40| 72 65 65 74 73 20 61 6e | 64 20 61 76 65 6e 75 65 |reets an|d avenue|
|00001e50| 73 0d 0a 74 68 61 74 20 | 72 75 6e 20 76 65 72 74 |s..that |run vert|
|00001e60| 69 63 61 6c 6c 79 20 61 | 6e 64 20 68 6f 72 69 7a |ically a|nd horiz|
|00001e70| 6f 6e 74 61 6c 6c 79 20 | 6f 76 65 72 20 74 68 65 |ontally |over the|
|00001e80| 20 73 63 72 65 65 6e 2e | 20 54 68 65 20 73 74 72 | screen.| The str|
|00001e90| 65 65 74 20 63 6f 72 6e | 65 72 73 0d 0a 66 6f 72 |eet corn|ers..for|
|00001ea0| 6d 20 61 20 72 65 63 74 | 61 6e 67 75 6c 61 72 20 |m a rect|angular |
|00001eb0| 67 72 69 64 2c 20 77 68 | 6f 73 65 20 73 69 7a 65 |grid, wh|ose size|
|00001ec0| 20 69 73 20 63 68 6f 73 | 65 6e 20 73 75 63 68 20 | is chos|en such |
|00001ed0| 74 68 61 74 20 69 74 20 | 6a 75 73 74 0d 0a 66 69 |that it |just..fi|
|00001ee0| 74 73 20 6f 6e 20 74 68 | 65 20 73 63 72 65 65 6e |ts on th|e screen|
|00001ef0| 2e 0d 0a 0d 0a 4f 6e 20 | 73 6f 6d 65 20 6f 66 20 |.....On |some of |
|00001f00| 74 68 65 20 63 6f 72 6e | 65 72 73 20 73 74 61 6e |the corn|ers stan|
|00001f10| 64 20 77 61 6c 6c 73 20 | 73 6f 20 74 68 61 74 20 |d walls |so that |
|00001f20| 4b 61 72 65 6c 20 63 61 | 6e 6e 6f 74 20 70 61 73 |Karel ca|nnot pas|
|00001f30| 73 2e 0d 0a 4f 6e 20 6f | 74 68 65 72 73 20 6d 61 |s...On o|thers ma|
|00001f40| 79 20 6c 69 65 20 62 65 | 65 70 65 72 73 20 74 68 |y lie be|epers th|
|00001f50| 61 74 20 4b 61 72 65 6c | 20 63 61 6e 20 70 69 63 |at Karel| can pic|
|00001f60| 6b 20 75 70 2e 20 48 65 | 20 63 61 6e 20 61 6c 73 |k up. He| can als|
|00001f70| 6f 0d 0a 6d 61 72 6b 20 | 61 20 63 6f 72 6e 65 72 |o..mark |a corner|
|00001f80| 20 62 79 20 64 72 6f 70 | 70 69 6e 67 20 61 20 62 | by drop|ping a b|
|00001f90| 65 65 70 65 72 2e 20 4b | 61 72 65 6c 20 6d 61 79 |eeper. K|arel may|
|00001fa0| 20 77 61 6c 6b 20 6f 76 | 65 72 20 68 69 73 20 77 | walk ov|er his w|
|00001fb0| 6f 72 6c 64 2c 0d 0a 62 | 75 74 20 6f 66 20 63 6f |orld,..b|ut of co|
|00001fc0| 75 72 73 65 20 68 65 20 | 73 68 6f 75 6c 64 20 6e |urse he |should n|
|00001fd0| 6f 74 20 6c 65 61 76 65 | 20 74 68 65 20 73 63 72 |ot leave| the scr|
|00001fe0| 65 65 6e 2e 0d 0a 0d 0a | 5c 73 75 62 73 65 63 74 |een.....|\subsect|
|00001ff0| 69 6f 6e 7b 4b 61 72 65 | 6c 27 73 20 61 63 74 69 |ion{Kare|l's acti|
|00002000| 6f 6e 73 7d 0d 0a 0d 0a | 41 66 74 65 72 20 72 65 |ons}....|After re|
|00002010| 61 64 69 6e 67 20 74 68 | 65 20 73 74 61 6e 64 61 |ading th|e standa|
|00002020| 72 64 20 70 61 63 6b 65 | 74 20 7b 5c 74 74 20 6b |rd packe|t {\tt k|
|00002030| 61 72 65 6c 7d 20 62 79 | 20 6d 65 61 6e 73 20 6f |arel} by| means o|
|00002040| 66 20 74 68 65 0d 0a 70 | 61 63 6b 65 74 2d 63 6f |f the..p|acket-co|
|00002050| 6d 6d 61 6e 64 20 28 7b | 5c 74 74 20 70 7d 29 20 |mmand ({|\tt p}) |
|00002060| 68 65 20 63 61 6e 20 70 | 65 72 66 6f 72 6d 20 74 |he can p|erform t|
|00002070| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 61 63 74 |he follo|wing act|
|00002080| 69 6f 6e 73 3a 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b |ions:...|.\begin{|
|00002090| 69 74 65 6d 69 7a 65 7d | 0d 0a 5c 69 74 65 6d 20 |itemize}|..\item |
|000020a0| 7b 5c 74 74 20 73 74 61 | 72 74 20 6b 61 72 65 6c |{\tt sta|rt karel|
|000020b0| 7d 5c 5c 0d 0a 09 53 65 | 74 73 20 75 70 20 74 68 |}\\...Se|ts up th|
|000020c0| 65 20 77 6f 72 6c 64 2c | 20 77 69 74 68 20 4b 61 |e world,| with Ka|
|000020d0| 72 65 6c 20 69 6e 20 74 | 68 65 20 6c 6f 77 65 72 |rel in t|he lower|
|000020e0| 20 6c 65 66 74 20 63 6f | 72 6e 65 72 20 0d 0a 09 | left co|rner ...|
|000020f0| 77 69 74 68 20 68 69 73 | 20 6e 6f 73 65 20 70 6f |with his| nose po|
|00002100| 69 6e 74 69 6e 67 20 74 | 6f 20 74 68 65 20 6e 6f |inting t|o the no|
|00002110| 72 74 68 3b 0d 0a 5c 69 | 74 65 6d 20 7b 5c 74 74 |rth;..\i|tem {\tt|
|00002120| 20 74 75 72 6e 20 72 69 | 67 68 74 7d 5c 5c 0d 0a | turn ri|ght}\\..|
|00002130| 09 4b 61 72 65 6c 20 6d | 61 6b 65 73 20 61 20 72 |.Karel m|akes a r|
|00002140| 69 67 68 74 20 74 75 72 | 6e 3b 0d 0a 5c 69 74 65 |ight tur|n;..\ite|
|00002150| 6d 20 7b 5c 74 74 20 74 | 75 72 6e 20 6c 65 66 74 |m {\tt t|urn left|
|00002160| 7d 5c 5c 0d 0a 09 4b 61 | 72 65 6c 20 6d 61 6b 65 |}\\...Ka|rel make|
|00002170| 73 20 61 20 6c 65 66 74 | 20 74 75 72 6e 3b 0d 0a |s a left| turn;..|
|00002180| 5c 69 74 65 6d 20 7b 5c | 74 74 20 6d 6f 76 65 7d |\item {\|tt move}|
|00002190| 5c 5c 0d 0a 09 4b 61 72 | 65 6c 20 6d 6f 76 65 73 |\\...Kar|el moves|
|000021a0| 20 6f 6e 65 20 63 6f 72 | 6e 65 72 20 66 6f 72 77 | one cor|ner forw|
|000021b0| 61 72 64 20 69 6e 20 74 | 68 65 20 64 69 72 65 63 |ard in t|he direc|
|000021c0| 74 69 6f 6e 20 6f 66 20 | 68 69 73 20 6e 6f 73 65 |tion of |his nose|
|000021d0| 3b 0d 0a 5c 69 74 65 6d | 20 7b 5c 74 74 20 74 61 |;..\item| {\tt ta|
|000021e0| 6b 65 20 62 65 65 70 65 | 72 7d 5c 5c 0d 0a 09 4b |ke beepe|r}\\...K|
|000021f0| 61 72 65 6c 20 74 61 6b | 65 73 20 74 68 65 20 62 |arel tak|es the b|
|00002200| 65 65 70 65 72 20 28 69 | 66 20 61 6e 79 29 20 66 |eeper (i|f any) f|
|00002210| 72 6f 6d 20 74 68 65 20 | 70 72 65 73 65 6e 74 0d |rom the |present.|
|00002220| 0a 09 63 6f 72 6e 65 72 | 20 61 6e 64 20 70 75 74 |..corner| and put|
|00002230| 73 20 69 74 20 69 6e 74 | 6f 20 68 69 73 20 70 6f |s it int|o his po|
|00002240| 63 6b 65 74 3b 0d 0a 5c | 69 74 65 6d 20 7b 5c 74 |cket;..\|item {\t|
|00002250| 74 20 64 72 6f 70 20 62 | 65 65 70 65 72 7d 5c 5c |t drop b|eeper}\\|
|00002260| 0d 0a 09 4b 61 72 65 6c | 20 74 61 6b 65 73 20 61 |...Karel| takes a|
|00002270| 20 62 65 65 70 65 72 20 | 66 72 6f 6d 20 74 68 65 | beeper |from the|
|00002280| 20 6c 69 6d 69 74 6c 65 | 73 73 20 73 75 70 70 6c | limitle|ss suppl|
|00002290| 79 0d 0a 09 69 6e 20 68 | 69 73 20 70 6f 63 6b 65 |y...in h|is pocke|
|000022a0| 74 20 61 6e 64 20 6c 65 | 61 76 65 73 20 69 74 20 |t and le|aves it |
|000022b0| 61 74 20 74 68 65 20 70 | 72 65 73 65 6e 74 20 63 |at the p|resent c|
|000022c0| 6f 72 6e 65 72 3b 0d 0a | 5c 69 74 65 6d 20 7b 5c |orner;..|\item {\|
|000022d0| 74 74 20 73 74 6f 70 7d | 5c 5c 0d 0a 09 4d 61 6b |tt stop}|\\...Mak|
|000022e0| 65 73 20 61 6e 20 65 6e | 64 20 74 6f 20 4b 61 72 |es an en|d to Kar|
|000022f0| 65 6c 20 61 6e 64 20 68 | 69 73 20 77 6f 72 6c 64 |el and h|is world|
|00002300| 2c 20 6c 69 66 74 69 6e | 67 20 68 69 6d 20 66 72 |, liftin|g him fr|
|00002310| 6f 6d 0d 0a 09 74 68 65 | 20 73 63 72 65 65 6e 2e |om...the| screen.|
|00002320| 0d 0a 5c 65 6e 64 7b 69 | 74 65 6d 69 7a 65 7d 0d |..\end{i|temize}.|
|00002330| 0a 0d 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 4b |...\subs|ection{K|
|00002340| 61 72 65 6c 27 73 20 63 | 6f 6e 64 69 74 69 6f 6e |arel's c|ondition|
|00002350| 73 7d 0d 0a 0d 0a 4b 61 | 72 65 6c 20 6b 6e 6f 77 |s}....Ka|rel know|
|00002360| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |s the fo|llowing |
|00002370| 63 6f 6e 64 69 74 69 6f | 6e 73 3a 0d 0a 0d 0a 5c |conditio|ns:....\|
|00002380| 62 65 67 69 6e 7b 69 74 | 65 6d 69 7a 65 7d 0d 0a |begin{it|emize}..|
|00002390| 5c 69 74 65 6d 20 7b 5c | 74 74 20 66 61 63 69 6e |\item {\|tt facin|
|000023a0| 67 20 6e 6f 72 74 68 7d | 5c 5c 0d 0a 09 54 72 75 |g north}|\\...Tru|
|000023b0| 65 20 6f 6e 6c 79 20 69 | 66 20 4b 61 72 65 6c 27 |e only i|f Karel'|
|000023c0| 73 20 6e 6f 73 65 20 70 | 72 65 73 65 6e 74 6c 79 |s nose p|resently|
|000023d0| 20 70 6f 69 6e 74 73 20 | 74 6f 20 74 68 65 20 6e | points |to the n|
|000023e0| 6f 72 74 68 3b 0d 0a 5c | 69 74 65 6d 20 7b 5c 74 |orth;..\|item {\t|
|000023f0| 74 20 66 61 63 69 6e 67 | 20 73 6f 75 74 68 7d 5c |t facing| south}\|
|00002400| 5c 0d 0a 09 53 69 6d 69 | 6c 61 72 6c 79 3b 0d 0a |\...Simi|larly;..|
|00002410| 5c 69 74 65 6d 20 7b 5c | 74 74 20 66 61 63 69 6e |\item {\|tt facin|
|00002420| 67 20 65 61 73 74 7d 5c | 5c 0d 0a 09 53 69 6d 69 |g east}\|\...Simi|
|00002430| 6c 61 72 6c 79 3b 0d 0a | 5c 69 74 65 6d 20 7b 5c |larly;..|\item {\|
|00002440| 74 74 20 66 61 63 69 6e | 67 20 77 65 73 74 7d 5c |tt facin|g west}\|
|00002450| 5c 0d 0a 09 53 69 6d 69 | 6c 61 72 6c 79 3b 0d 0a |\...Simi|larly;..|
|00002460| 5c 69 74 65 6d 20 7b 5c | 74 74 20 66 61 63 69 6e |\item {\|tt facin|
|00002470| 67 20 77 61 6c 6c 7d 5c | 5c 0d 0a 09 54 72 75 65 |g wall}\|\...True|
|00002480| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 6e 65 78 | only if| the nex|
|00002490| 74 20 63 6f 72 6e 65 72 | 20 63 6f 6e 74 61 69 6e |t corner| contain|
|000024a0| 73 20 61 20 77 61 6c 6c | 3b 0d 0a 5c 69 74 65 6d |s a wall|;..\item|
|000024b0| 20 7b 5c 74 74 20 62 65 | 65 70 65 72 7d 5c 5c 0d | {\tt be|eper}\\.|
|000024c0| 0a 09 54 72 75 65 20 6f | 6e 6c 79 20 69 66 20 74 |..True o|nly if t|
|000024d0| 68 65 72 65 20 69 73 20 | 61 20 62 65 65 70 65 72 |here is |a beeper|
|000024e0| 20 6c 79 69 6e 67 20 61 | 74 20 74 68 65 20 70 72 | lying a|t the pr|
|000024f0| 65 73 65 6e 74 20 63 6f | 72 6e 65 72 2e 0d 0a 5c |esent co|rner...\|
|00002500| 65 6e 64 7b 69 74 65 6d | 69 7a 65 7d 0d 0a 0d 0a |end{item|ize}....|
|00002510| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 54 68 65 20 |\subsect|ion{The |
|00002520| 62 61 73 69 63 20 4b 61 | 72 65 6c 2d 70 61 63 6b |basic Ka|rel-pack|
|00002530| 65 74 7d 0d 0a 0d 0a 54 | 68 65 20 73 74 61 6e 64 |et}....T|he stand|
|00002540| 61 72 64 20 70 61 63 6b | 65 74 20 7b 5c 74 74 20 |ard pack|et {\tt |
|00002550| 6b 61 72 65 6c 7d 2c 20 | 77 72 69 74 74 65 6e 20 |karel}, |written |
|00002560| 69 6e 20 45 6c 61 6e 2d | 30 2c 0d 0a 72 65 61 6c |in Elan-|0,..real|
|00002570| 69 7a 65 73 20 74 68 65 | 20 61 63 74 69 6f 6e 73 |izes the| actions|
|00002580| 20 61 6e 64 20 74 65 73 | 74 73 20 6a 75 73 74 20 | and tes|ts just |
|00002590| 64 65 73 63 72 69 62 65 | 64 2e 0d 0a 41 73 20 61 |describe|d...As a|
|000025a0| 20 66 69 72 73 74 20 65 | 78 61 6d 70 6c 65 20 77 | first e|xample w|
|000025b0| 65 20 73 68 6f 77 20 61 | 20 70 72 6f 67 72 61 6d |e show a| program|
|000025c0| 20 74 68 61 74 20 6d 61 | 6b 65 73 20 4b 61 72 65 | that ma|kes Kare|
|000025d0| 6c 20 74 72 75 6e 64 6c | 65 0d 0a 61 72 6f 75 6e |l trundl|e..aroun|
|000025e0| 64 20 61 20 73 71 75 61 | 72 65 20 6f 66 20 31 36 |d a squa|re of 16|
|000025f0| 20 2a 20 31 36 2e 20 49 | 74 20 73 68 6f 75 6c 64 | * 16. I|t should|
|00002600| 20 62 65 20 65 6e 74 65 | 72 65 64 20 61 66 74 65 | be ente|red afte|
|00002610| 72 0d 0a 74 68 65 20 70 | 61 63 6b 65 74 20 7b 5c |r..the p|acket {\|
|00002620| 74 74 20 6b 61 72 65 6c | 7d 20 68 61 73 20 62 65 |tt karel|} has be|
|00002630| 65 6e 20 72 65 61 64 20 | 28 7b 5c 74 74 20 70 7d |en read |({\tt p}|
|00002640| 29 2e 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 65 6c 61 |).....\b|egin{ela|
|00002650| 6e 7d 0d 0a 64 72 61 77 | 20 73 71 75 61 72 65 20 |n}..draw| square |
|00002660| 3a 0d 0a 20 20 73 74 61 | 72 74 20 6b 61 72 65 6c |:.. sta|rt karel|
|00002670| 20 3b 0d 0a 20 20 55 50 | 54 4f 20 34 0d 0a 20 20 | ;.. UP|TO 4.. |
|00002680| 52 45 50 20 64 72 61 77 | 20 73 69 64 65 0d 0a 20 |REP draw| side.. |
|00002690| 20 45 4e 44 52 45 50 20 | 3b 0d 0a 20 20 73 74 6f | ENDREP |;.. sto|
|000026a0| 70 20 2e 0d 0a 0d 0a 64 | 72 61 77 20 73 69 64 65 |p .....d|raw side|
|000026b0| 20 3a 0d 0a 20 20 55 50 | 54 4f 20 31 36 0d 0a 20 | :.. UP|TO 16.. |
|000026c0| 20 52 45 50 20 64 72 6f | 70 20 62 65 65 70 65 72 | REP dro|p beeper|
|000026d0| 20 3b 0d 0a 20 20 20 20 | 20 20 6d 6f 76 65 0d 0a | ;.. | move..|
|000026e0| 20 20 45 4e 44 52 45 50 | 20 3b 0d 0a 20 20 74 75 | ENDREP| ;.. tu|
|000026f0| 72 6e 20 72 69 67 68 74 | 20 2e 0d 0a 5c 65 6e 64 |rn right| ...\end|
|00002700| 7b 65 6c 61 6e 7d 0d 0a | 0d 0a 5c 73 75 62 73 65 |{elan}..|..\subse|
|00002710| 63 74 69 6f 6e 7b 4b 61 | 72 65 6c 27 73 20 65 6e |ction{Ka|rel's en|
|00002720| 76 69 72 6f 6e 6d 65 6e | 74 7d 0d 0a 0d 0a 54 68 |vironmen|t}....Th|
|00002730| 65 20 70 61 63 6b 65 74 | 20 7b 5c 74 74 20 65 6e |e packet| {\tt en|
|00002740| 76 7d 69 72 6f 6e 6d 65 | 6e 74 20 63 61 6e 20 62 |v}ironme|nt can b|
|00002750| 65 20 75 73 65 64 20 74 | 6f 20 64 65 63 6f 72 61 |e used t|o decora|
|00002760| 74 65 0d 0a 4b 61 72 65 | 6c 27 73 20 77 6f 72 6c |te..Kare|l's worl|
|00002770| 64 20 77 69 74 68 20 61 | 20 68 6f 75 73 65 2c 20 |d with a| house, |
|00002780| 61 20 73 74 61 69 72 20 | 6f 72 20 61 20 6c 61 62 |a stair |or a lab|
|00002790| 79 72 69 6e 74 68 2e 20 | 54 68 65 20 70 72 6f 67 |yrinth. |The prog|
|000027a0| 72 61 6d 0d 0a 77 69 6c | 6c 20 66 6f 72 20 74 68 |ram..wil|l for th|
|000027b0| 61 74 20 70 75 72 70 6f | 73 65 20 68 61 76 65 20 |at purpo|se have |
|000027c0| 74 6f 20 63 61 6c 6c 20 | 6f 6e 65 20 6f 66 20 74 |to call |one of t|
|000027d0| 68 65 20 61 63 74 69 6f | 6e 73 0d 0a 0d 0a 5c 62 |he actio|ns....\b|
|000027e0| 65 67 69 6e 7b 69 74 65 | 6d 69 7a 65 7d 0d 0a 5c |egin{ite|mize}..\|
|000027f0| 69 74 65 6d 09 7b 5c 74 | 74 20 6d 61 6b 65 20 6c |item.{\t|t make l|
|00002800| 61 62 79 72 69 6e 74 68 | 7d 3b 0d 0a 5c 69 74 65 |abyrinth|};..\ite|
|00002810| 6d 09 7b 5c 74 74 20 6d | 61 6b 65 20 73 74 61 69 |m.{\tt m|ake stai|
|00002820| 72 7d 3b 0d 0a 5c 69 74 | 65 6d 09 7b 5c 74 74 20 |r};..\it|em.{\tt |
|00002830| 6d 61 6b 65 20 68 6f 75 | 73 65 7d 2e 0d 0a 5c 65 |make hou|se}...\e|
|00002840| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0d 0a 0d 0a 5c |nd{itemi|ze}....\|
|00002850| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 54 68 65 20 70 72 |noindent|..The pr|
|00002860| 6f 67 72 61 6d 20 77 68 | 69 63 68 20 66 6f 6c 6c |ogram wh|ich foll|
|00002870| 6f 77 73 20 73 69 6d 75 | 6c 61 74 65 73 20 4b 61 |ows simu|lates Ka|
|00002880| 72 65 6c 20 66 65 74 63 | 68 69 6e 67 20 68 69 73 |rel fetc|hing his|
|00002890| 20 6d 6f 72 6e 69 6e 67 | 20 70 61 70 65 72 2e 0d | morning| paper..|
|000028a0| 0a 49 74 20 6d 61 6b 65 | 73 20 75 73 65 20 6f 66 |.It make|s use of|
|000028b0| 20 62 6f 74 68 20 74 68 | 65 20 70 61 63 6b 65 74 | both th|e packet|
|000028c0| 20 7b 5c 74 74 20 6b 61 | 72 65 6c 7d 20 61 6e 64 | {\tt ka|rel} and|
|000028d0| 20 74 68 65 20 70 72 65 | 63 65 64 69 6e 67 20 7b | the pre|ceding {|
|000028e0| 5c 74 74 20 65 6e 76 7d | 69 72 6f 6e 6d 65 6e 74 |\tt env}|ironment|
|000028f0| 0d 0a 70 61 63 6b 65 74 | 2e 20 49 74 20 69 73 20 |..packet|. It is |
|00002900| 75 73 65 64 20 61 73 20 | 61 6e 20 69 6e 74 72 6f |used as |an intro|
|00002910| 64 75 63 74 6f 72 79 20 | 65 78 61 6d 70 6c 65 20 |ductory |example |
|00002920| 69 6e 20 74 68 65 20 74 | 65 78 74 62 6f 6f 6b 20 |in the t|extbook |
|00002930| 28 73 65 65 20 5b 32 5d | 29 2e 0d 0a 0d 0a 5c 62 |(see [2]|).....\b|
|00002940| 65 67 69 6e 7b 65 6c 61 | 6e 7d 0d 0a 70 72 6f 67 |egin{ela|n}..prog|
|00002950| 72 61 6d 20 3a 0d 0a 20 | 20 73 74 61 72 74 20 6b |ram :.. | start k|
|00002960| 61 72 65 6c 20 3b 0d 0a | 20 20 6d 61 6b 65 20 68 |arel ;..| make h|
|00002970| 6f 75 73 65 20 3b 0d 0a | 20 20 77 61 6c 6b 20 74 |ouse ;..| walk t|
|00002980| 6f 20 67 61 72 64 65 6e | 20 3b 0d 0a 20 20 74 61 |o garden| ;.. ta|
|00002990| 6b 65 20 6e 65 77 73 70 | 61 70 65 72 20 3b 0d 0a |ke newsp|aper ;..|
|000029a0| 20 20 77 61 6c 6b 20 62 | 61 63 6b 20 74 6f 20 62 | walk b|ack to b|
|000029b0| 65 64 20 2e 0d 0a 20 0d | 0a 77 61 6c 6b 20 74 6f |ed ... .|.walk to|
|000029c0| 20 67 61 72 64 65 6e 20 | 3a 0d 0a 20 20 77 61 6c | garden |:.. wal|
|000029d0| 6b 20 61 6c 6f 6e 67 20 | 77 61 6c 6c 20 3b 0d 0a |k along |wall ;..|
|000029e0| 20 20 77 61 6c 6b 20 74 | 68 72 6f 75 67 68 20 65 | walk t|hrough e|
|000029f0| 6e 74 72 61 6e 63 65 20 | 3b 0d 0a 20 20 77 61 6c |ntrance |;.. wal|
|00002a00| 6b 20 74 6f 20 6e 65 77 | 73 70 61 70 65 72 20 2e |k to new|spaper .|
|00002a10| 0d 0a 20 0d 0a 74 61 6b | 65 20 6e 65 77 73 70 61 |.. ..tak|e newspa|
|00002a20| 70 65 72 20 3a 0d 0a 20 | 20 74 61 6b 65 20 62 65 |per :.. | take be|
|00002a30| 65 70 65 72 20 2e 0d 0a | 20 0d 0a 77 61 6c 6b 20 |eper ...| ..walk |
|00002a40| 62 61 63 6b 20 74 6f 20 | 62 65 64 20 3a 0d 0a 20 |back to |bed :.. |
|00002a50| 20 77 61 6c 6b 20 62 61 | 63 6b 20 74 6f 20 65 6e | walk ba|ck to en|
|00002a60| 74 72 61 6e 63 65 20 3b | 0d 0a 20 20 77 61 6c 6b |trance ;|.. walk|
|00002a70| 20 62 61 63 6b 20 74 68 | 72 6f 75 67 68 20 65 6e | back th|rough en|
|00002a80| 74 72 61 6e 63 65 20 3b | 0d 0a 20 20 77 61 6c 6b |trance ;|.. walk|
|00002a90| 20 62 61 63 6b 20 61 6c | 6f 6e 67 20 77 61 6c 6c | back al|ong wall|
|00002aa0| 20 2e 0d 0a 0d 0a 77 61 | 6c 6b 20 61 6c 6f 6e 67 | .....wa|lk along|
|00002ab0| 20 77 61 6c 6c 20 3a 0d | 0a 20 20 74 75 72 6e 20 | wall :.|. turn |
|00002ac0| 72 69 67 68 74 20 3b 0d | 0a 20 20 6d 6f 76 65 20 |right ;.|. move |
|00002ad0| 3b 0d 0a 20 20 6d 6f 76 | 65 20 3b 0d 0a 20 20 6d |;.. mov|e ;.. m|
|00002ae0| 6f 76 65 20 3b 0d 0a 20 | 20 6d 6f 76 65 20 3b 0d |ove ;.. | move ;.|
|00002af0| 0a 20 20 6d 6f 76 65 20 | 2e 0d 0a 0d 0a 77 61 6c |. move |.....wal|
|00002b00| 6b 20 74 6f 20 6e 65 77 | 73 70 61 70 65 72 20 3a |k to new|spaper :|
|00002b10| 0d 0a 20 20 74 75 72 6e | 20 6c 65 66 74 20 3b 0d |.. turn| left ;.|
|00002b20| 0a 20 20 6d 6f 76 65 20 | 3b 0d 0a 20 20 6d 6f 76 |. move |;.. mov|
|00002b30| 65 20 3b 0d 0a 20 20 74 | 75 72 6e 20 6c 65 66 74 |e ;.. t|urn left|
|00002b40| 20 3b 0d 0a 20 20 6d 6f | 76 65 20 3b 0d 0a 20 20 | ;.. mo|ve ;.. |
|00002b50| 6d 6f 76 65 20 3b 0d 0a | 20 20 74 75 72 6e 20 72 |move ;..| turn r|
|00002b60| 69 67 68 74 20 3b 0d 0a | 20 20 6d 6f 76 65 20 2e |ight ;..| move .|
|00002b70| 0d 0a 20 0d 0a 77 61 6c | 6b 20 62 61 63 6b 20 74 |.. ..wal|k back t|
|00002b80| 6f 20 65 6e 74 72 61 6e | 63 65 20 3a 0d 0a 20 20 |o entran|ce :.. |
|00002b90| 74 75 72 6e 20 61 62 6f | 75 74 20 3b 0d 0a 20 20 |turn abo|ut ;.. |
|00002ba0| 6d 6f 76 65 20 3b 0d 0a | 20 20 74 75 72 6e 20 6c |move ;..| turn l|
|00002bb0| 65 66 74 20 3b 0d 0a 20 | 20 6d 6f 76 65 20 3b 0d |eft ;.. | move ;.|
|00002bc0| 0a 20 20 6d 6f 76 65 20 | 3b 0d 0a 20 20 74 75 72 |. move |;.. tur|
|00002bd0| 6e 20 72 69 67 68 74 20 | 3b 0d 0a 20 20 6d 6f 76 |n right |;.. mov|
|00002be0| 65 20 3b 0d 0a 20 20 6d | 6f 76 65 20 2e 0d 0a 20 |e ;.. m|ove ... |
|00002bf0| 0d 0a 77 61 6c 6b 20 62 | 61 63 6b 20 74 68 72 6f |..walk b|ack thro|
|00002c00| 75 67 68 20 65 6e 74 72 | 61 6e 63 65 20 3a 0d 0a |ugh entr|ance :..|
|00002c10| 20 20 74 75 72 6e 20 72 | 69 67 68 74 20 3b 0d 0a | turn r|ight ;..|
|00002c20| 20 20 6d 6f 76 65 20 3b | 0d 0a 20 20 6d 6f 76 65 | move ;|.. move|
|00002c30| 20 3b 0d 0a 20 20 6d 6f | 76 65 20 3b 0d 0a 20 20 | ;.. mo|ve ;.. |
|00002c40| 6d 6f 76 65 20 2e 0d 0a | 20 0d 0a 77 61 6c 6b 20 |move ...| ..walk |
|00002c50| 62 61 63 6b 20 61 6c 6f | 6e 67 20 77 61 6c 6c 20 |back alo|ng wall |
|00002c60| 3a 0d 0a 20 20 74 75 72 | 6e 20 72 69 67 68 74 20 |:.. tur|n right |
|00002c70| 3b 0d 0a 20 20 6d 6f 76 | 65 20 3b 0d 0a 20 20 6d |;.. mov|e ;.. m|
|00002c80| 6f 76 65 20 3b 0d 0a 20 | 20 6d 6f 76 65 20 3b 0d |ove ;.. | move ;.|
|00002c90| 0a 20 20 6d 6f 76 65 20 | 3b 0d 0a 20 20 6d 6f 76 |. move |;.. mov|
|00002ca0| 65 20 2e 0d 0a 20 0d 0a | 74 75 72 6e 20 61 62 6f |e ... ..|turn abo|
|00002cb0| 75 74 20 3a 0d 0a 20 20 | 74 75 72 6e 20 72 69 67 |ut :.. |turn rig|
|00002cc0| 68 74 20 3b 0d 0a 20 20 | 74 75 72 6e 20 72 69 67 |ht ;.. |turn rig|
|00002cd0| 68 74 20 2e 0d 0a 20 0d | 0a 77 61 6c 6b 20 74 68 |ht ... .|.walk th|
|00002ce0| 72 6f 75 67 68 20 65 6e | 74 72 61 6e 63 65 20 3a |rough en|trance :|
|00002cf0| 0d 0a 20 20 74 75 72 6e | 20 6c 65 66 74 20 3b 0d |.. turn| left ;.|
|00002d00| 0a 20 20 6d 6f 76 65 20 | 3b 0d 0a 20 20 6d 6f 76 |. move |;.. mov|
|00002d10| 65 20 3b 0d 0a 20 20 6d | 6f 76 65 20 3b 0d 0a 20 |e ;.. m|ove ;.. |
|00002d20| 20 6d 6f 76 65 20 2e 0d | 0a 5c 65 6e 64 7b 65 6c | move ..|.\end{el|
|00002d30| 61 6e 7d 0d 0a 0d 0a | |an}.... | |
+--------+-------------------------+-------------------------+--------+--------+